<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        
        a{
            text-decoration: none;
        }
        .hover-tips{
            display: block;
            position: relative;
            padding: 0 20px;
            border-radius: 10px;
            height: 40px; /* 标准盒子模型 box-sizing: box-border; */
            background: #66f;

        }
        .hover-tips + .hover-tips{
            margin-top: 10px;
        }
        .btn-1::after{
            content: attr(data-msg);
            position: absolute;
            left: 0;
            top: 0;
            border-radius: 5px;width: 100%;
            height: 100%;
            background-color: rgba(0,0,0,0.5);
            opacity: 0;
            text-align: center;
            font-size: 12px;
            transition: all 300ms;
        }
        .btn-1:hover::after{
            left: calc(100% + 20px);
            opacity: 1;
        }
    </style>
</head>
<body>
    <div class="bruce flex-ct-y" data-title="使用attr（）抓取节点属性">
        <a href="https://www.baidu.com" data-msg="Hello World" 
        class="hover-tips btn-1">提示框</a>
        <a href="https://www.baidu.com" class="hover-tips btn-2"></a>
</div>
</body>
</html>